/**
 * author      : dormi330
 * date        : 2020-03-19
 * description : an object that declares that it can be adapted
 */

package org.dormi.learn.implA;

import org.eclipse.core.runtime.IAdapterFactory;

public class ItemSDOFactory1 implements IAdapterFactory {

    @Override
    public Object getAdapter(Object srcObj, Class adapterType) {
        if (adapterType == InsuranceItem.class && srcObj instanceof ItemSDOImplA) {
            ItemSDOImplA o = (ItemSDOImplA) srcObj;
            return new InsuranceItem(o.isInsurance());
        }
        return null;
    }

    @Override
    public Class[] getAdapterList() {
        return new Class[]{InsuranceItem.class};
    }
}
